#include <stdio.h>
#include <stdlib.h>

void func(char ar[], int i,int j)
{
	if (i < j)
	{
		char tmp = ar[i];
		ar[i] = ar[j];
		ar[j] = tmp;
		func(ar, i + 1, j - 1);
	}
}

int main()
{
	char ar[] = "abcdef";
	int size = sizeof(ar) / sizeof(ar[0]);
	func(ar, 0,size-2);
	printf("%s\n", ar);
	system("pause");
	return 0;
}